﻿Type=Activity
Version=6
ModulesStructureVersion=1
B4A=true
@EndOfDesignText@
#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: False

#End Region

Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.

End Sub

Sub Globals
	'These global variables will be redeclared each time the activity is created.
	'These variables can only be accessed from this module.
	Private btnfindteacher As Label
	Private btnleft As Label
	Private lvteachers As UltimateListView
	Private tabfindteacher As Label
	Private tabfudaoban As Label
	Private fltfujing As Label
	Private fltshaixuan As Label
	Private pfudaoban As Panel
	'Private lvfudaoban As clsCustomListView
	Private btnsearchteacher As ImageView
	Private cdNor,cdPre As BitmapDrawable
	Private fltpaixu As Label
	Private ivpaixu As ImageView
	Private fltnianji As Label
	Private ivffujin As ImageView
	Private ivshaixuan As ImageView
	Dim ani As AnimationPlus
	Private pfujinpop As Panel
	Private lvquyu As ListView
	Private lvquyu2 As ListView
	Private pShaixuanPop As Panel
	Private shaixuanpricerang As Label
	Private shaixuanteachertype As Label
	Private shaixuanshangkefangshi As Label
	Private shaixuanshangkeshijian As Label
	Private shaixuanshanchanglinyu As Label
	Private pbotbar As Panel
	Private lvnianji As ListView
	Private lvkemu As clsCustomListView
	Private pnianji As Panel
	Private ivnianji As ImageView
	Private lstKemu,lstnianji,lstData,lstFudaoban As List
	Private curst As Subject
	Private curFilterM As Map
	Private ulvfudaoban As UltimateListView
	Private bLoading=False,bScrolling=False As Boolean '下拉刷新用的
	Private btnleft As Label
	Dim lstpaixu As List
	Private ptitlebg As Panel
	Private btnfindtecbymap As Label
	Private btnhelpyoufindteacher As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim telaw As telanywhere
telaw.Initialize(Activity)

	'Do not forget to load the layout file created with the visual designer. For example:
	Activity.LoadLayout("layfindteacher")
	initviews
End Sub
Sub initviews
	'ProgressDialogShow2("正在加载请稍后",False)
	comm.setFA(btnleft,"fa-angle-left","")
	comm.setFA(btnhelpyoufindteacher,"fa-users"," 帮你找老师")
	comm.setFA(btnfindtecbymap,"fa-map"," 地图找老师")
	btnleft.TextColor=Colors.Gray
	curst=g_store.get("curst")
	Dim nmsgd As Int=125dip
	lvteachers.Color=0xffeeeeee
	ulvfudaoban.Color=0xffeeeeee
	Dim cd As ColorDrawable
	cd.Initialize(0xFFEFEFEF,0)
	lvteachers.DividerHeight=3dip
	lvteachers.DividerDrawable=cd
	lvteachers.AddLayout("itemteacher","lvteachers_layout","lvteachers_filldata",nmsgd,True)
	lvteachers.AddLayout("itemrefush","lvteachers_layout","lvteachers_filldata",60dip,True)
	curFilterM.Initialize
	'构建区域lv
'	Dim cs As CityShi
'	lvquyu.SingleLineLayout.Label.TextColor=Colors.Black
'	lvquyu2.SingleLineLayout.Label.TextColor=Colors.Black
'	For i=0 To comm.getCurShen.lst.Size-1
'		cs=comm.getCurShen.lst.Get(i)
'		lvquyu.AddSingleLine2(cs.name,cs)
'		
'	Next
'	Dim cs As CityShi
'	cs=comm.getCityArr(g_store.getDef("curcity","乌鲁木齐"))
'	
'	For j=0 To cs.lst.Size-1
'			lvquyu2.AddSingleLine2(cs.lst.Get(j),cs.lst.Get(j))
'	Next

	curFilterM.Put("city",g_store.getDef("curcity","乌鲁木齐"))
	'curFilterM.Put("diqu",cs.lst.Get(0))
	curFilterM.Put("fl_id",curst.id)
	curFilterM.Put("km",1000) '1000km
	'设置当前选择项目
	fltfujing.Text="全市"
	fltnianji.Text=curst.name
	Dim l=5dip,t=1dip,b=1dip,r=25dip As Int
	comm.SetPadding(fltfujing,l,t,r,b)
	comm.SetPadding(fltnianji,l,t,r,b)
	comm.SetPadding(fltpaixu,l,t,r,b)
	comm.SetPadding(fltshaixuan,l,t,r,b)
	cdNor.Initialize(LoadBitmap(File.DirAssets,"bg_findteacher_title1.png"))
	cdPre.Initialize(LoadBitmap(File.DirAssets,"bg_findteacher_title2.png"))
	chgPage(0)
	Dim nFDB_H As Int=245dip
	Dim cd As ColorDrawable
	cd.Initialize(0xFFEFEFEF,0)
	ulvfudaoban.DividerDrawable=cd
	ulvfudaoban.DividerHeight=1dip
	lvteachers.DividerDrawable=cd
	lvteachers.DividerHeight=1dip
	ulvfudaoban.AddLayout("itemfudaoban","lvteachers_layout","fudaoban_ContentFiller",nFDB_H,True)
'	For i=0 To 5
'		lvfudaoban.Add(CreateItemFudaoban(100%x,nFDB_H),nFDB_H,i)
'	Next
	
	lstpaixu.Initialize
	lstpaixu.AddAll(g_store.conf.Get(comm.S_PAIXU_FINDTEACHER))
	Dim lstnianji As List
	lstnianji.Initialize
	lstnianji.AddAll(g_store.conf.Get(comm.S_NIANJI_FINDTEACHER))
	lstKemu=g_store.conf.Get(comm.S_SUBJECTS)
	Dim cd As ColorDrawable
	cd.Initialize(comm.N_COLOR_TITLE,0)
	lstFudaoban.Initialize
	Dim ts As Subject
	For i=0 To lstKemu.Size-1
		ts=lstKemu.Get(i)
		lvkemu.AddTextItem(ts.name,i)
		'lvkemu.AddSingleLine(ts.name)
	Next
	lstnianji=g_store.conf.Get(comm.S_NIANJI_FINDTEACHER)
	'lvnianji.SingleLineLayout.Background=cd
	lvnianji.SingleLineLayout.Label.TextSize=18
	lvnianji.SingleLineLayout.Label.TextColor=Colors.Black
	For i=0 To lstnianji.Size-1
		lvnianji.AddSingleLine(lstnianji.Get(i))
	Next
	comm.aio(Activity)
	pbotbar.BringToFront
	lstData.Initialize
	reqTecLst(curFilterM)
End Sub
Sub parseNearby(str As String)
	Dim lst As List=ParseHelper.parseTeacher(str)
	Dim am As clsAMap2DCaller
	am.Initialize
	Dim mplst As List
	mplst.Initialize
	Dim t As Teacher
	For i=0 To lst.Size-1
		t=lst.Get(i)
		Dim mp As MapPoint
		mp.Initialize
		mp.lng=t.lng
		mp.lat=t.lat
		mp.poiname=t.nickname
		mp.text=t.adWords
		mp.tag=t
		mplst.Add(mp)
	Next
	am.BiaoZhu(mplst,"地图找老师")
End Sub
'Sub lvquyu_ItemClick (Position As Int, Value As Object)
'	Dim cs As CityShi=Value
'	lvquyu2.Clear
'	For j=0 To cs.lst.Size-1
'			lvquyu2.AddSingleLine2(cs.lst.Get(j),cs.lst.Get(j))
'	Next
'End Sub
Sub lvteachers_layout(LayoutName As String, LayoutPanel As Panel)
	LayoutPanel.LoadLayout(LayoutName)
End Sub
'下拉刷新

Sub lvteachers_Overscrolled(Action As Int, ScrollY As Int)
	'Log("A:"&Action&"  Y:"&ScrollY)
	Select Action
	Case 2'按下
		If bScrolling=False And ScrollY<-100 Then 
			lvteachers.InsertItemAt("itemrefush",0,0)	
			bScrolling=True
		End If
	Case 1'放开
		If bScrolling Then
			bScrolling=False
			lvteachers.RemoveItemAt(0)
			If ScrollY<-100 And bLoading=False Then '防止重复加载
				Log("req refush once")
				reqTecLst(curFilterM)
			End If
		End If
	End Select
End Sub
Sub fudaoban_ContentFiller(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)
	Dim coldata As Map=lstFudaoban.Get(ItemID)

	 Dim sk_address_id As String = coldata.Get("sk_address_id") 
    Dim kc_end_time As String = coldata.Get("kc_end_time") 
    Dim is_youhui As String = coldata.Get("is_youhui") 
    Dim kc_title As String = coldata.Get("kc_title") 
    Dim kc_num As String = coldata.Get("kc_num") 
    Dim shiduan As List = coldata.Get("shiduan") 
    For Each colshiduan As Map In shiduan 
        Dim kc_id As String = colshiduan.Get("kc_id") 
        Dim sd_start_time As String = colshiduan.Get("sd_start_time") 
        Dim sd_money As String = colshiduan.Get("sd_money") 
        Dim sd_end_time As String = colshiduan.Get("sd_end_time") 
        Dim riqi As String = colshiduan.Get("riqi") 
        Dim id As String = colshiduan.Get("id") 
        Dim sd_mode As String = colshiduan.Get("sd_mode") 
        Dim sd_hour As String = colshiduan.Get("sd_hour") 
        Dim status As String = colshiduan.Get("status") 
    Next 
    Dim bm_person As String = coldata.Get("bm_person") 
    Dim kc_mode As String = coldata.Get("kc_mode") 
    Dim kc_address As String = coldata.GetDefault("kc_address","") 
    Dim kc_grade As String = coldata.Get("kc_grade") 
    Dim kc_money_bk As String = coldata.GetDefault("kc_money_bk","")
    Dim addtime As String = coldata.Get("addtime") 
    Dim js_id As String = coldata.Get("js_id") 
    Dim kc_type As String = coldata.Get("kc_type") 
    Dim id As String = coldata.Get("id") 
    Dim kc_address As String = coldata.Get("kc_address") 
    Dim kc_hour As String = coldata.Get("kc_hour") 
    Dim status As String = coldata.Get("status") 
	Dim p As Panel=LayoutPanel.GetView(0)
	Dim lbltitle As Label=p.GetView(0)
	lbltitle.Text=kc_title
	Dim lblstarttime As Label=p.GetView(2)
	lblstarttime.Text=kc_end_time
	Dim price As Label=p.GetView(4)
	price.Text=$"￥$1.2{kc_money_bk}"$
	Dim hours As Label=p.GetView(5)
	hours.Text="（共:"&kc_hour&"小时)"
	comm.setViewWrapContent(price)
	hours.Left=price.Left+price.Width+5dip
	Dim lblstatus As Label=p.GetView(6)
	lblstatus.Text=$"可报名${kc_num}人，已报名${bm_person}人"$
	Dim lbladdr As Label=p.GetView(9)
	lbladdr.Text=kc_address
	Dim btnbm As Label=p.GetView(10)
	btnbm.Tag=ItemID
	
End Sub
'辅导班立即报名
Sub btnlijibaoming_Click
	Dim v As View=Sender
	Dim idx As Int=v.Tag
	Dim coldata As Map=lstFudaoban.Get(idx)
	Dim kci As kcItem
	kci.Initialize
'	 Dim sk_address_id As String = coldata.Get("sk_address_id") 
'    Dim kc_end_time As String = coldata.Get("kc_end_time") 
'    Dim is_youhui As String = coldata.Get("is_youhui") 
    Dim kc_title As String = coldata.Get("kc_title") 
    Dim kc_num As String = coldata.Get("kc_num") 
	kci.shiduanlst=coldata.Get("shiduan") 
	If kci.shiduanlst.IsInitialized=False Then kci.shiduanlst.Initialize
'    Dim shiduan As List = coldata.Get("shiduan") 
'    For Each colshiduan As Map In shiduan 
'        Dim kc_id As String = colshiduan.Get("kc_id") 
'        Dim sd_start_time As String = colshiduan.Get("sd_start_time") 
'        Dim sd_money As String = colshiduan.Get("sd_money") 
'        Dim sd_end_time As String = colshiduan.Get("sd_end_time") 
'        Dim riqi As String = colshiduan.Get("riqi") 
'        Dim id As String = colshiduan.Get("id") 
'        Dim sd_mode As String = colshiduan.Get("sd_mode") 
'        Dim sd_hour As String = colshiduan.Get("sd_hour") 
'        Dim status As String = colshiduan.Get("status") 
'    Next 
    Dim bm_person As String = coldata.Get("bm_person") 
    Dim kc_mode As String = coldata.Get("kc_mode") 
    Dim kc_grade As String = coldata.Get("kc_grade") 
    Dim kc_money_bk As String = coldata.Get("kc_money_bk") 
    Dim addtime As String = coldata.Get("addtime") 
    Dim js_id As String = coldata.Get("js_id") 
    Dim kc_type As String = coldata.Get("kc_type") 
    Dim id As String = coldata.Get("id") 
    Dim kc_address As String = coldata.Get("kc_address") 
    Dim kc_hour As String = coldata.Get("kc_hour") 
    Dim status As String = coldata.Get("status") 
	

	kci.kctitle=kc_title
	kci.hours=kc_hour
	kci.addr=kc_address
	kci.price_xsdz=kc_money_bk
	kci.kcid=id
	
	g_store.put("curkc",kci)
	StartActivity(actBuyFudanKC)
End Sub
Sub lvteachers_filldata(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)
	If LayoutName.ToLowerCase.CompareTo("itemteacher")<>0 Then Return
	
	Dim riv As ImageView=LayoutPanel.GetView(10)
	Dim tec As Teacher=lstData.Get(ItemID)
	If tec.headimg<>Null And tec.headimg.Length>5 Then comm.loadimgroundcorn(tec.headimg,riv,comm.N_ROUNDCORN,1)
	Dim nickname As Label=LayoutPanel.GetView(11)
	nickname.Text=tec.nickname
	Dim ivsex As ImageView=LayoutPanel.GetView(12)
	If tec.sexMen Then
		ivsex.Bitmap=comm.bmpSexMan
		comm.setivsexsize(ivsex,True)
	Else
		ivsex.Bitmap=comm.bmpSexWoman
		ivsex.Width=10dip
		comm.setivsexsize(ivsex,False)
	End If
	Dim stprice As Label=LayoutPanel.GetView(0)
	stprice.Text=$"￥$1.0{tec.startPrice}元/小时起"$
	'comm.setFA(stprice,"fa-rmb"," "&tec.startPrice&"起")
	Dim tecAge As Label=LayoutPanel.GetView(1)
	tecAge.Text=tec.teacheAge&"年教龄"
	Dim ads As Label=LayoutPanel.GetView(2)
	ads.Text=tec.adWords
	Dim rates As Label=LayoutPanel.GetView(3)
	rates.Text=$"评论数：${tec.rateNum}条 好评率：${tec.ratePercent}"$ 
	Dim dis As Label=LayoutPanel.GetView(9)
	comm.setFA(dis,"fa-map-marker"," "&tec.distence)
	comm.setViewWrapContent(nickname)
	ivsex.Left=nickname.Left+nickname.Width+5dip
	tecAge.Left=ivsex.Left+ivsex.Width+5dip
	Dim zz() As Label=Array As Label(LayoutPanel.GetView(4),LayoutPanel.GetView(5),LayoutPanel.GetView(6),LayoutPanel.GetView(7),LayoutPanel.GetView(8))
	Dim n As Int=0'资质
	If tec.zzsfz.EqualsIgnoreCase("2") Then
		comm.updateZZ(zz(n),"实名")
		n=n+1
	End If
	If tec.zzxuewei.EqualsIgnoreCase("2") Then
		comm.updateZZ(zz(n),"学位")
		n=n+1
	End If
	If tec.zzzhengshu.EqualsIgnoreCase("2") Then
		comm.updateZZ(zz(n),"证书")
		n=n+1
	End If
	If tec.zzzige.EqualsIgnoreCase("2") Then
		comm.updateZZ(zz(n),"资格")
		n=n+1
	End If
	If tec.zzxinji.EqualsIgnoreCase("1") Then
		comm.updateZZ(zz(n),"一星")
		n=n+1
	else if tec.zzxinji.EqualsIgnoreCase("2") Then
		comm.updateZZ(zz(n),"二星")
		n=n+1
	else If tec.zzxinji.EqualsIgnoreCase("3") Then
		comm.updateZZ(zz(n),"三星")
		n=n+1
	else if tec.zzxinji.EqualsIgnoreCase("4") Then
		comm.updateZZ(zz(n),"四星")
		n=n+1
	else if tec.zzxinji.EqualsIgnoreCase("5") Then
		comm.updateZZ(zz(n),"五星")
		n=n+1
	Else if tec.zzxinji.EqualsIgnoreCase("99") Then
		comm.updateZZ(zz(n),"特级")
		n=n+1
	End If
End Sub

#Region web
Sub reqAllFudaoban
	comm.showProgress("正在获取班课列表")
	ParseHelper.doGetReq(Me,"reqallfdb",comm.getApi(comm.apiIdx.REQALLFUDAOBAN),Null)
End Sub
Sub reqTecLst(m As Map)
	comm.showProgress("正在获取老师列表")
	ParseHelper.doPostReqMap(Me,"reqteclst",comm.getApi(comm.apiIdx.REQTEACHERLIST),m,"")
End Sub

Sub JobDone(thj As HttpJob)
	ProgressDialogHide
	If thj.Success Then
		Dim str As String=thj.GetString
		Dim nr As netRes=ParseHelper.getStatusData(str)
		Select thj.JobName
		Case "getnearby"
			If nr.nCode=200 Then
				parseNearby(str)
			Else
				comm.TL("获取附近老师错误:"&nr.sData)
			End If
			
		Case "reqteclst"
			If nr.nCode=200 Then
				'parseTeacherLst(str)
				Log(str)
				lstData=ParseHelper.parseTeacher(str)
				lvteachers.ClearContent
				For i=0 To lstData.Size-1
					lvteachers.AddItem("itemteacher",i)
				Next
				lvteachers.RefreshContent
			Else
				comm.TL("错误:"&nr.sData)
			End If
		Case "reqallfdb"
			If nr.nCode=200 Then
				'Log(str)
				parseFudaoban(str)
			Else
				comm.TL("错误:"&nr.sData)
			End If
		Case Else
			Log(str)
		End Select
		
	Else
		comm.TL("网络错误:"&thj.ErrorMessage)
	End If
	thj.Release
End Sub
Private Sub parseFudaoban(str As String)
	Dim parser As JSONParser 
	parser.Initialize(str) 
	Dim root As Map = parser.NextObject 
	Dim data As List = root.Get("data") 
	lstFudaoban.Clear
	ulvfudaoban.ClearContent
	For Each coldata As Map In data 
		lstFudaoban.Add(coldata)
	Next 
	ulvfudaoban.BulkAddItems(lstFudaoban.Size,"itemfudaoban",0)

End Sub
#End Region
'地图找老师
Sub mapabclick_Click
	comm.showProgress("正在获取附近的老师数据")
	ParseHelper.doGetReq(Me,"getnearby",comm.getApi(comm.apiIdx.GETNEARBYTEACHER),Null)
End Sub

'Sub fltnianji_item_clicked
'	Dim selected As String
'	Dim lst As List=g_store.conf.Get(comm.S_NIANJI_FINDTEACHER)
'	selected=lst.Get(fltnianji.SelectedIndex)
'	ToastMessageShow(selected,False)
'	
'End Sub
Sub RoateView(v As View,from As Float,toF As Float)
	ani.InitializeRotateCenter("ani",from,toF,v)
	ani.Duration=200
	ani.PersistAfter=True
	ani.Start(v)
End Sub
Sub ani_AnimationEnd
	'ani.Stop()
End Sub


Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub chgPage(idx As Int)
	Select idx
	Case 0
		'找老师
		pfudaoban.SendToBack
		pfudaoban.Visible=False
		tabfindteacher.TextColor=Colors.White
		tabfudaoban.TextColor=Colors.Black
		ptitlebg.Background=cdNor
	Case 1
		'辅导班
		pfudaoban.BringToFront
		pfudaoban.Visible=True
		tabfindteacher.TextColor=Colors.Black
		tabfudaoban.TextColor=Colors.White
		ptitlebg.Background=cdPre
		reqAllFudaoban
	End Select
End Sub
Sub ivback_Click
	Activity.Finish
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
	If KeyCodes.KEYCODE_BACK==KeyCode Then
		If pfujinpop.Visible Then
			fltfujing_Click
			Return True
		End If
		If pShaixuanPop.Visible Then
			fltshaixuan_Click
			Return True
		End If
		If pnianji.Visible Then
			fltnianji_Click
			Return True
		End If

	End If
	Return False
End Sub
Sub tabfudaoban_Click
	chgPage(1)
End Sub

Sub tabfindteacher_Click
	chgPage(0)
End Sub
Sub lvteachers_ItemClick(ItemID As Long, Position As Int, ClickedPanel As Panel)
	Dim tec As Teacher=lstData.Get(ItemID)	
	g_store.put("tecid",tec.ID)
	StartActivity(actTeacherDetail)
End Sub

Sub lvteachers_EmptyView(LayoutPanel As Panel)
	LayoutPanel.LoadLayout("itemempty")
End Sub
'底部的帮你找老师按钮
Sub btnfindteacher_Click
	StartActivity(acthelpyoufindteacher)
End Sub

Sub btnsearchteacher_Click
	
End Sub
Private Sub chgNianjiP
	pnianji.BringToFront
	pnianji.Visible=Not(pnianji.Visible)
End Sub
Private Sub chgFujinP
'	pfujinpop.Visible=Not(pfujinpop.Visible)
'	pfujinpop.BringToFront
'	lvquyu.BringToFront
'	lvquyu2.BringToFront
	Dim cs As CityShi
	cs=comm.getCityArr(g_store.getDef("curcity","乌鲁木齐"))
	Dim ret As Int=InputList(cs.lst,"选择区域",-1)
	Dim ts As String
	If ret>-1 Then
		ts=cs.lst.Get(ret)
		If ts.Length>5 Then ts=ts.SubString2(ts.Length-5,ts.Length)
		curFilterM.Put("diqu",ts)
		fltfujing.Text=ts
'		comm.setViewWrapContent(fltfujing)
'		ivffujin.Left=fltfujing.Left+fltfujing.Width-20dip
		reqTecLst(curFilterM)
	End If
	'做出选择或者取消后自动回归小箭头方向
	Dim i As Int =ivffujin.Tag
	If i=0 Then
		RoateView(ivffujin,0,180)
		ivffujin.Tag=1
	Else
		RoateView(ivffujin,180,0)
		ivffujin.Tag=0
	End If
End Sub
Private Sub chgPaixu
	Dim ret As Int=InputList(lstpaixu,"选择排序",-1)
	Dim selected As String
	If ret>-1 Then
		Dim lst As List=g_store.conf.Get(comm.S_PAIXU_FINDTEACHER)
		selected=lst.Get(ret)
		curFilterM.Put("paixu",ret)
		reqTecLst(curFilterM)'刷新数据
		fltpaixu.Text=selected
		Log(selected)
	End If
	'做出选择或者取消后自动回归小箭头方向
	Dim i As Int =ivpaixu.Tag
	If i=0 Then
		RoateView(ivpaixu,0,180)
		ivpaixu.Tag=1
	Else
		RoateView(ivpaixu,180,0)
		ivpaixu.Tag=0
	End If
End Sub
Private Sub chgShaixuanP
	pShaixuanPop.BringToFront
	pShaixuanPop.Visible=Not(pShaixuanPop.Visible)
End Sub
Sub fltshaixuan_Click
	Dim i As Int =ivshaixuan.Tag
	If i=0 Then
		RoateView(ivshaixuan,0,180)
		ivshaixuan.Tag=1
	Else
		RoateView(ivshaixuan,180,0)
		ivshaixuan.Tag=0
	End If
	chgShaixuanP
End Sub


Sub fltnianji_Click
	Dim i As Int =ivnianji.Tag
	If i=0 Then
		RoateView(ivnianji,0,180)
		ivnianji.Tag=1
	Else
		RoateView(ivnianji,180,0)
		ivnianji.Tag=0
	End If
	chgNianjiP
End Sub
Sub fltpaixu_Click
	Dim i As Int =ivpaixu.Tag
	If i=0 Then
		RoateView(ivpaixu,0,180)
		ivpaixu.Tag=1
	Else
		RoateView(ivpaixu,180,0)
		ivpaixu.Tag=0
	End If
	chgPaixu
End Sub
Sub fltfujing_Click
	Dim i As Int =ivffujin.Tag
	If i=0 Then
		RoateView(ivffujin,0,180)
		ivffujin.Tag=1
	Else
		RoateView(ivffujin,180,0)
		ivffujin.Tag=0
	End If
	chgFujinP
End Sub

Sub lvfudaoban_ItemClick (Index As Int, Value As Object)
	
	StartActivity(actBuyFudanKC)
End Sub

'Sub lvquyu2_ItemClick (Position As Int, Value As Object)
'	curFilterM.Put("diqu",Value)
'	reqTecLst(curFilterM)
'	chgFujinP
'End Sub


Sub shaixuanpricerang_Click
	Dim lst As List
	lst.Initialize
	lst.AddAll(Array As String("不限制","100-200元","200-300元","300-500元","500-1000元","1000元以上"))
	Dim ret As Int=InputList(lst,"选择价格区间",0)
	If ret>-1 Then
		shaixuanpricerang.Text=lst.Get(ret)
		Select ret
		Case 1
			curFilterM.Put("money","100-200")
		Case 2
			curFilterM.Put("money","200-300")
		Case 3
			curFilterM.Put("money","300-500")
		Case 4
			curFilterM.Put("money","500-1000")
		Case 5
			curFilterM.Put("money","1000")
		End Select
	Else
		curFilterM.Remove("money")
	End If
End Sub

Sub shaixuanteachertype_Click
	Dim lst As List
	lst.Initialize
	lst.AddAll(Array As String("不限制","独立老师","在职教师","在校大学生","机构老师"))
	Dim ret As Int=InputList(lst,"教师人群",0)
	If ret>-1 Then
		shaixuanteachertype.Text=lst.Get(ret)
		If ret>0 Then 	curFilterM.Put("type",ret)
	Else
		curFilterM.Remove("type")
	End If
	
End Sub

Sub shaixuanshangkefangshi_Click
	Dim lst As List
	lst.Initialize
	lst.AddAll(Array As String("不限制","老师上门","学生上门","协商地点"))
	Dim ret As Int=InputList(lst,"上课方式",0)
	If ret>-1 Then
		shaixuanshangkefangshi.Text=lst.Get(ret)
		Select ret
		Case 1
			curFilterM.Put("js_sm",1)
		Case 2
			curFilterM.Put("xs_sm",1)
		Case 3
			curFilterM.Put("xs",1)
		End Select
	End If
End Sub
'
'Sub shaixuanshangkeshijian_Click
'	Dim lst As List
'	lst.Initialize
'	lst.AddAll(Array As String("不限制","星期一","星期二","星期三","星期四","星期五","星期六","星期日"))
'	Dim retLst As List=InputMultiList(lst,"上课时间")
'	Dim ret As String=""
'	For i=0 To retLst.Size-1
'		ret=ret&" "&lst.Get(retLst.Get(i))
'	Next
'	If ret.Length>1 Then
'		'ret=ret.SubString2(0,ret.Length-1)
'		shaixuanshangkeshijian.Text=ret
'	End If
'	
'End Sub

Sub shaixuanshanchanglinyu_Click
	Dim lst As List
	lst.Initialize
	lst.AddAll(Array As String("不限制","培优","拔高","提差"))
	Dim ret As Int=InputList(lst,"擅长领域",0)
	If ret>-1 Then
		shaixuanshanchanglinyu.Text=lst.Get(ret)
		If ret>0 Then	curFilterM.Put("ly",ret)
	Else
		curFilterM.Remove("ly")
	End If
End Sub

Sub btnshaixuanok_Click
	fltshaixuan_Click
	reqTecLst(curFilterM)
End Sub

Sub lvkemu_ItemClick (Index As Int, Value As Object)
	curst=lstKemu.Get(Value)
	curFilterM.Put("fl_id",curst.id)
	fltnianji.Text=curst.name
End Sub

Sub lvnianji_ItemClick (Position As Int, Value As Object)
	Log(Value)
	curFilterM.Put("nj",Value)
	fltnianji.Text=Value&curst.name
'	comm.setViewWrapContent(fltnianji)
'	ivnianji.Left=fltnianji.Left+fltnianji.Width-25dip
	chgNianjiP
	'做出选择或者取消后自动回归小箭头方向
	Dim i As Int =ivnianji.Tag
	If i=0 Then
		RoateView(ivnianji,0,180)
		ivnianji.Tag=1
	Else
		RoateView(ivnianji,180,0)
		ivnianji.Tag=0
	End If
	reqTecLst(curFilterM)
End Sub

Sub rbsexnan_CheckedChange(Checked As Boolean)
	If Checked Then curFilterM.Put("sex",1)
End Sub

Sub rbsexnv_CheckedChange(Checked As Boolean)
	If Checked Then curFilterM.Put("sex",2)
End Sub

Sub rbsexall_CheckedChange(Checked As Boolean)
	If Checked Then curFilterM.Remove("sex")
End Sub

